# -*-coding:utf-8 -*-
import threading,time

def process():
    for i in range(3):
        time.sleep(1)
        print("thread name is %s"%threading.current_thread().name)

if __name__=="__main__":
    print("-----主进程开始-----")
    # 创建4个线程，存入列表中
    threads = [threading.Thread(target=process) for i in range(4)]
    for t in threads:
        # 开启线程
        t.start()
    for t in threads:
        # 等待子线程结束
        t.join()
    print("-----主线程结束-----")